<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>test</title>

</head>

<script type="text/javascript" src = "js/jquery-3.2.1.js"></script>
<script>

         function selectDaAn() {
                 var timu = document.getElementById("data").value;
                 $.ajax({
                     url: "/auto/showDaAn.do",
                     type: "post",
                     datatype: "json",
                     data: {
                         'timu': timu
                     },
                     success: function (data, state) {
                         document.getElementById("daan").innerHTML=data;
                     },
                     error: function () {

                     }
                 })
             }

</script>
<span id="daan"></span>
<br>
<input id="data" style="width: 1000px;height: 20px" onblur="selectDaAn()">
<br/>
<br/>
</body>
<script>
    $(document).ready(function(){
        var ss= GetQueryString("timu");
        document.getElementById("data").value=ss;
        document.getElementById("data").focus();
        document.getElementById("data").blur();
    });

    function getByClass(parent, cls){
        if(parent.getElementsByClassName){
            return parent.getElementsByClassName(cls);
        }else{
            var res = [];
            var reg = new RegExp(' ' + cls + ' ', 'i')
            var ele = parent.getElementsByTagName('*');
            for(var i = 0; i < ele.length; i++){
                if(reg.test(' ' + ele[i].className + ' ')){
                    res.push(ele[i]);
                }
            }
            return res;
        }
    }
    function rr() {
        var myArray=getByClass(document,'w_fz18');
        var array = new Array();
        var j=0;
        // var myArray=getByClass(document,'w_fz18')[1].innerHTML;
         for (i=2;i<=myArray.length;i=i+8){
             array[j]=myArray[i];
             j++
         }
         for (i=0;i<=array.length;i++){
             // alert(array[i].innerHTML);
         }
        var b;
        b = array.join("-");
        alert(getBytesLength(b));
    }

    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var URL =  decodeURI(window.location.search);
        var r = URL.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    };


    function getBytesLength(str) {
        return str.replace(/[^\x00-\xff]/g, 'xx').length;
    }

</script>
</html>
